class SiteMailer < ActionMailer::Base
  def signup_notification(user)
    setup_email(user)
    @subject    += 'Please activate your new account'
    @body[:url]  = "#{SITE}/activate/#{user.activation_code}"
  end
  
  def forgot_password(user)
    setup_email(user)
    @subject    += 'Password Change Request'
    @body[:url]  = "#{SITE}/reset_password/#{user.password_reset_code}" 
  end
  
  def reset_password(user)
    setup_email(user)
    @subject    += 'Password Reset'
  end
  
  protected
  def setup_email(user)
    @recipients  = "#{user.email}"
    @from        = "ln@cs.washington.edu"
    @subject     = "[#{SITE_NAME}] "
    @sent_on     = Time.now
    @body[:user] = user
  end
end
